﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using G.Navigate;

namespace ReadNovel.View.Book
{
    public partial class BookReadPage : GBasePage
    {
        public BookReadPage()
        {
            InitializeComponent();
        }
        string textId = "8787439";
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            this.RegisterLoading(null);
            GloabalData.Instance.Client.Execute(new API.Request.Book.ReadOnlineRequest() { TextId=textId }, (c) =>
            {
                this.UnregisterLoading();
                if (c.IsOk)
                {
                    txt.Text = c.Text;
                }
                else
                {
                    this.ShowState(c.ErrorMessage);
                }

            });
        }

    }
}